#!/bin/bash
# Description:
#	sharefile through scp

######## custom function ########
share () {
	if [[ -f ./"$1" ]]; then
		scp ./"$1" "$User"@"$RemoteHost":"$RemoteDir"
	else
		scp "$User"@"$RemoteHost":"$RemoteDir/$1" .
	fi
}

######## Main ########


case $HOSTNAME in
	SidNote )
		User=yqchen
		RemoteHost="sofie.pku.edu.cn"
		RemoteDir="/workdir/yqchen/tmp/"
		share "$1"
		;;
	* ) echo "Unknown host name" ;;
esac
